package com.zgm.utils;

import android.util.Log;

import java.util.concurrent.atomic.AtomicBoolean;

/**
 * Created by 张公铭 on 2017/7/7 0007.
 */

public class WaitUtils
{
    public static void Waiting(AtomicBoolean locke, int waitTimes)
    {
        int times = 0;
        while (!locke.get() && times < waitTimes)
        {
            try
            {
                Thread.sleep(1000);
                times += 1000;
            } catch (InterruptedException e)
            {
                e.printStackTrace();
            }
            Log.i("xxx", locke.get() + "-------------");
        }
    }
}
